package net.pimpas.report.processor.condition.impl;

import net.pimpas.report.processor.condition.ConditionType;
import net.pimpas.report.processor.exception.ConditionException;
import net.pimpas.report.processor.field.Field;
import net.pimpas.report.processor.resolver.FieldPropertyResolver;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

public class IsNotEmptyCondition extends IsEmptyCondition {

	private static final long serialVersionUID = -297011186173548033L;

	public IsNotEmptyCondition(Field field) {
		super(field);
		this.setType(ConditionType.IS_NOT_EMPTY);
	}
	
	@Override
	public Criterion process(String fieldAlias, FieldPropertyResolver resolver) throws ConditionException {
		return Restrictions.not(super.process(fieldAlias, resolver));
	}
}